package one.stand.controller;

import one.stand.model.ResultModel;
import one.stand.request.UserCouponRequest;
import one.stand.response.UserCouponResponse;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: QIK
 * @CreateDate: 2019/6/24 17:40
 */
@RestController
@RequestMapping("user/coupon")
public class UserCouponController  extends BaseController {

    /**
     * 领取优惠券
     * @param request
     * @return
     */
    @PostMapping("receive")
    public ResultModel<Boolean> receive(@RequestBody UserCouponRequest request){
        return userCouponService.receive(request);
    }

    /**
     * 用户自己的优惠券列表
     * @param request
     * @return
     */
    @PostMapping("myList")
    public ResultModel<List<UserCouponResponse>> myList(@RequestBody UserCouponRequest request){
        return userCouponService.myList(request);
    }
    /**
     * 自己未领取的优惠券
     * @param request
     * @return
     */
    @PostMapping("noReceive")
    public ResultModel<List<UserCouponResponse>> noReceive(@RequestBody UserCouponRequest request){
        return userCouponService.noReceive(request);
    }
}
